{extend name="public/common"} {block name="body"}
<title>基本设置</title>
</head>
<style type="text/css">
	 .radius:hover{
 	color: #fff;
	border-color: #66b1ff;
	background-color: #66b1ff;
 }
 span:hover{
 	color: #333;
 }
  .btn-primary {
    color: #fff;
    background-color: #5a98de;
    border-color: #5a98de;
    height: 31px;
    border-radius: 5px;
    font-size: 14px;
    line-height: 24px !important;
}
</style>
<body>
	<nav class="breadcrumb">
		<i class="Hui-iconfont">&#xe67f;</i>
		
		 系统管理
		<span class="c-gray en">&gt;</span>
		
		 APP管理
		<span class="c-gray en">&gt;</span>
		 版本管理
		<span class="c-gray en">&gt;</span>
		{if(isset($query.version))}版本修改{else /}新增版本{/if}
		<a class="btn btn-success radius r"
			style="line-height: 1.6em; margin-top: 3px"
			href="javascript:location.replace(location.href);" title="刷新">
			<i class="Hui-iconfont">&#xe68f;</i>
		</a>
	</nav>

	<article class="page-container">
		<form class="form form-horizontal" action="" enctype="multipart/form-data" id="form-admin-add" method="post">
		<div class="row cl">
						<label class="form-label col-xs-4 col-sm-2">
							<span class="c-red">*</span>
							版本：
						</label>
						<div class="formControls col-xs-8 col-sm-9">
							<input type="text" name="version" id="website_title" value="{$query.version?$query.version:''}" style="width:60%;" class="input-text">
						</div>
					</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>序号：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" onchange="this.value=this.value.replace(/\D/g,'')" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" name="number" id="website_title_a" value="{$query.number?$query.number:''}" style="width:60%;" class="input-text">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>强制升级：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="radio" name="upgrade" value="1" {if(isset($query.upgrade) && $query.upgrade=='1')}checked{/if} style=""><span style="margin-right:20px;">是</span>
					<input type="radio" name="upgrade" value="2" {if( (isset($query.upgrade) && $query.upgrade=='2') || !isset($query.upgrade))}checked{/if} style=""><span style="margin-right:20px;">否</span>
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>类型选择：</label>
				<div class="formControls col-xs-8 col-sm-9">
				{foreach($que as $k=>$val)}
					<input type="radio" name="type" value="{$val.id}" {if( (isset($query.type) && $query.type==$val.id)||(!isset($query.type)&&1==$k))}checked{/if} style=""><span style="margin-right:20px;">{$val.classtype}</span>
				{/foreach}
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>APP类型：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="radio" name="systemtype" value="1" {if((isset($query.systemtype) && $query.systemtype=='1') || !isset($query.systemtype))}checked{/if} style="" onclick="qiehuan_name(1)"><span style="margin-right:20px;">安卓</span>
					<input type="radio" name="systemtype" value="2" {if(isset($query.systemtype) && $query.systemtype=='2')}checked{/if} style="" onclick="qiehuan_name(2)"><span style="margin-right:20px;">ios</span>
				</div>
			</div>
			<div class="row cl" id="version_file">
				<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span><span id="file_name">apk文件：</span></label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="file" name="file" value="" style="">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2">描述：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<textarea id="desc" name="desc" rows="4" style="width:60%;">{$query.desc?$query.desc:''}</textarea>
				</div>
			</div>
			<div class="row cl">
				<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
					<button class="btn btn-primary radius" type="submit">
						<i class="Hui-iconfont">&#xe632;</i>
						保存
					</button>
					<div class="btn btn-primary radius" onclick="javascript:history.go(-1);">
						<i class="Hui-iconfont">&#xe632;</i>
						返回
					</div>
				</div>
				
			</div>
		</form>
	</article>
	{/block}
{block name="js"}
<script type="text/javascript" src="__SYSMET__/common.js"></script>
<script type="text/javascript" src="__SYSMET__/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="__SYSMET__/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="__SYSMET__/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript">
function qiehuan_name(tui){
	if(tui==1){
		$('#file_name').html("apk文件：");
	}
	if(tui==2){
		$('#file_name').html("ipa文件：");
	}
	
}
//表单验证
$("#form-admin-add").submit(function(){
	var title = $("#website_title").val();
	var numb = $("#website_title_a").val();
	if(title == ''){
		layer.msg('请输入版本号', {icon: 5});
		return false;
	}
	if(numb == ''){
		layer.msg('请输入序号', {icon: 5});
		return false;
	}
	layer.msg('上传中...', {
		icon: 16,
		shade: 0.01,
		time:false
	});
})
</script>
{/block}
